Repository navigation
feat: Fit the HTML file iframe to its content height - #45
Merged
Merged
Conversation
HTML ファイルページの iframe は高さ 80vh 固定で中を送っていたため、スマホでは中と外のスクロールが取り合い、外側は iframe の外の端でしか送れなかった。 - srcdoc の末尾に、中身の高さを postMessage で親へ送る HTML_FIT_SCRIPT を足す(sandbox は allow-scripts のみのまま) - FILE_SCRIPT が送り元の iframe を確かめ、受け取った高さに伸ばす。上限は 50000px。100vh に余白を足した中身のように、同じ幅で伸び続ける場合は止める - JavaScript が無いときと高さが届くまでは、これまでどおり 80vh - 保証台帳と README を更新 Claude-Session: https://claude.ai/code/session_01V1Zinm1dJGihd2ZdPZCzjM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HTML ファイルページの iframe(高さ 80vh 固定)がスマホでスクロールを取り合う問題を直す。iframe を中身の高さまで伸ばし、スクロールを外側の1本にまとめる。Issue は立てず、user の指示で直接実装した。
変更
codeview/render.py: srcdoc の末尾にHTML_FIT_SCRIPTを足す。中身の高さをpostMessageで親へ送る(送るのは数値だけ)。sandbox はallow-scriptsのみのままcodeview/layout.py:FILE_SCRIPTが送り元の iframe を照合し、受け取った高さを当てる。上限は 50000px。同じ幅で伸び続ける場合(100vh に余白を足した中身など)は止めるdocs/guarantees/build.md・README(日英)・テストを更新確認
nix develop -c pytest -q: 95 passedhtml/body height:100%ではみ出す文書は 4824px まで伸びたhttps://claude.ai/code/session_01V1Zinm1dJGihd2ZdPZCzjM